import React from "react";
import {adminRoutes} from './route/admin';
import {Switch, Route} from "react-router-dom";
import 'antd/dist/antd.css';
import './Admin.css';
import AdminLayout from "./component/layout/admin/AdminLayout";

function Admin() {
  return (
	  <AdminLayout>
		  <Switch>
			  {adminRoutes.map(item => {
				  return (
					  <Route
						  path={item.path}
						  key={item.path}
						  exact={item.exact}
						  render={routeProps => {
							  return <item.component
								  {...routeProps}
								  routes={item.children} />
						  }}/>
				  )
			  })}
		  </Switch>
	  </AdminLayout>
  );
}

export default Admin;
